public class LambdaTest {

  String a;

  public LambdaTest(String a) {
    this.a = a;
  }

  private void print(Func b) {
    System.out.println(b.exec(3, 5));
    System.out.println("this:" + hashCode());
  }

  private void mytest(Func func) {
//    System.out.println("this hascode:"+hashCode()+" t hascode:" + t.hashCode());
    System.out.println("woshifunc:" + func.exec(100, 30));
  }

  private static String func(int x, int y) {
    System.out.println("func this:" );
    return x*y + "";
  }

  public static void main(String[] args) {
    LambdaTest test = new LambdaTest("Hello");
//    int a = 5;
//    Func add = (x, y) -> x + y  + test.a;
//    System.out.println(add.exec(1, 2));
//    System.out.println("main this:" + test.hashCode());
////    test.print(LambdaTest::func);
//    Func a = new Func() {
//      @Override
//      public String exec(int x, int y) {
//        return null;
//      }
//    };
    test.mytest((x, y) -> x * y + x + "");

  }
}

@FunctionalInterface
interface Func {
  String exec(int x, int y);
}